//
//  UIColor+Random.m
//
//  Created by Lee on 16/4/21.
//  Copyright © 2016年 zify. All rights reserved.
//

/**
 *  @brief UIColor + Random 产生随机颜色
 */

#import "UIColor+Random.h"

@implementation UIColor (Random)

/**
 *  @brief 获取随机颜色
 *
 *  @return 返回随机颜色
 */
+ (UIColor *)randomColor {
    static BOOL seeded = NO;
    if (!seeded) {
        seeded = YES;
        (time(NULL));
    }
    CGFloat red = (CGFloat)random() / (CGFloat)RAND_MAX;
    CGFloat green = (CGFloat)random() / (CGFloat)RAND_MAX;
    CGFloat blue = (CGFloat)random() / (CGFloat)RAND_MAX;
    return [UIColor colorWithRed:red green:green blue:blue alpha:1.0f];
}

@end
